<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <div class="box1">
        <div class="box2">
            <div class="box3"></div>
            <div class="box4"></div>
            <div class="box5"></div>
            <div class="box6"></div>
            <div class="box7"></div>
            <div class="box8"></div>
            <div class="box9"></div>
        </div>
    </div>

    <script src="./js/jquery.min.js"></script>
    <script>

        // 父子关系
        var $box6 = $('.box6');

        

        // 兄弟关系
        // .prev() 前一个兄弟
        console.log($box6.prev())
        // .prevAll() 前面所有兄弟
        console.log($box6.prevAll())

        // .next()  下一个兄弟
        console.log($box6.next())
        // .nextAll() 后面所有兄弟
        console.log($box6.nextAll())

        // .siblings() 所有兄弟 排除自己
        console.log($box6.siblings())
    </script>
</body>

</html>